<template>
	<view :class="[primarySize()]">
		<view class="container">
			<view class="ptb20 plr30">
				<view class="posts_item" v-for="(item,index) in list">
					<view class="flex-box">
						<view class="fwb fs36 col3 m-ellipsis pr15 maxw60">{{item.job.job_name}}</view>
						<view class="urgent" v-if="item.job.in_hurry">急聘</view>
						<view class="flex-grow-1 tr fs32 fwb col4">{{item.job.salary_text}}</view>
					</view>
					<view class="mt15 col6 fs24 lh34">{{item.enterpriseinfo.full_name}}</view>
					<view class="clearfix pt10">
						<view class="tips_item">{{item.job.education_level.name || ''}}</view>
						<view class="tips_item">{{item.job.work_experience.name || ''}}</view>
					</view>
					<view class="flex-box mt30">
						<image :src="item.job && item.job.user?cdnurl(item.job.user.avatar):''" mode="aspectFill" class="company_cover"></image>
						<view class="flex-grow-1 pl10 lh30">
							<view class="flex-box">
							<view class="col6 fs22 flex-grow-1">{{item.job && item.job.user?item.job.user.nickname : ''}}</view>
							<view class="fs22 cola5">{{item.job.locations[0].city.name+" "+item.job.locations[0].district.name}}</view>
								
							</view>
						</view>
					</view>
				</view>
				
				<view class="nothing" v-if="listMore.nothing">
					<image src="https://admin.mosizp.cn/static/public/icon_nothing.png" mode="aspectFit"></image>
					<text>暂无相关信息</text>
				</view>
				<view class="g-btn3-wrap" v-else>
					<view class="g-btn3" @click="fetchJob()">{{listMore.text}}</view>
				</view>
				
			</view>
		</view>
	</view>
</template>

<script>
	const app = getApp();
	export default {
		data() {
			return {
				
				list: [],
				listMore: {page: 1}
			}
		},
		onReady() {
			uni.setNavigationBarColor({
				frontColor: '#ffffff',
				backgroundColor: this.primaryColor()
			})
		},
		onLoad() {
			
			this.fetch();
		},
		onReachBottom() {
			this.fetch();
		},
		methods: {
			fetch() {
			    this.$util.fetch(this, 'xilujob.job_apply/apply_list', {}, 'listMore', 'list', '');
			}
		}
	}
</script>

<style lang="scss" scoped>
	.posts_item {
		width: 690rpx;
		padding: 30rpx;
		background: #FFFFFF;
		box-shadow: 0rpx 0rpx 20rpx 0rpx rgba(0, 0, 0, 0.03);
		border-radius: 18rpx;
		margin-bottom: 20rpx;

		.tips_item {
			height: 32rpx;
			background: #ECEFF5;
			border-radius: 4rpx;
			font-weight: 400;
			font-size: 22rpx;
			color: #A5A5A5;
			line-height: 32rpx;
			display: inline-block;
			vertical-align: top;
			margin-right: 10rpx;
			margin-top: 10rpx;
			padding: 0 8rpx;
		}

		.urgent {
			width: 74rpx;
			height: 37rpx;
			line-height: 33rpx;
			text-align: center;
			font-size: 24rpx;
			color: #FF7B20;
			border-radius: 6rpx;
			border: 2rpx solid #FF7B20;
		}

		.company_cover {
			width: 40rpx;
			height: 40rpx;
			border-radius: 50%;
		}

	}
</style>